package me.leiusual.sharing.ui.shop

import androidx.lifecycle.ViewModel
import dagger.Binds
import dagger.Module
import dagger.android.ContributesAndroidInjector
import dagger.multibindings.IntoMap
import me.leiusual.sharing.di.FragmentScope
import me.leiusual.sharing.di.ViewModelKey

/**
 * author: leiusual
 * create on: 2019-07-27
 * description:
 */
@Module
abstract class ShopModule {

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopApplyFragment(): ShopApplyFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopApplyViewModel::class)
  abstract fun shopApplyViewModel(shopApplyViewModel: ShopApplyViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopBankEditFragment(): ShopBankEditFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopBankEditViewModel::class)
  abstract fun shopBankEditViewModel(shopBankEditViewModel: ShopBankEditViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopBankFragment(): ShopBankFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopBankViewModel::class)
  abstract fun shopBankViewModel(shopBankViewModel: ShopBankViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopBusinessApplyFragment(): ShopBusinessApplyFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopBusinessApplyViewModel::class)
  abstract fun shopBusinessApplyViewModel(shopBusinessApplyViewModel: ShopBusinessApplyViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopBusinessLevelFragment(): ShopBusinessLevelFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopBusinessLevelViewModel::class)
  abstract fun shopBusinessLevelViewModel(shopBusinessLevelViewModel: ShopBusinessLevelViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopBusinessFragment(): ShopBusinessFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopBusinessViewModel::class)
  abstract fun shopBusinessViewModel(shopBusinessViewModel: ShopBusinessViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopHomeFragment(): ShopHomeFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopHomeViewModel::class)
  abstract fun shopHomeViewModel(shopHomeViewModel: ShopHomeViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopManageFragment(): ShopManageFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopManageViewModel::class)
  abstract fun shopManageViewModel(shopManageViewModel: ShopManageViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopWithdrawEditFragment(): ShopWithdrawEditFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopWithdrawEditViewModel::class)
  abstract fun shopWithdrawEditViewModel(shopWithdrawEditViewModel: ShopWithdrawEditViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun shopWithdrawFragment(): ShopWithdrawFragment

  @Binds
  @IntoMap
  @ViewModelKey(ShopWithdrawViewModel::class)
  abstract fun shopWithdrawViewModel(shopWithdrawViewModel: ShopWithdrawViewModel): ViewModel
}